package chapter4.lessons;

import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

/**
 * @Project ：learn_java
 * @File ：ThreadPoolExecutorDemo01.java
 * @IDE ：IntelliJ IDEA
 * @Author ：自由如风间
 * @Date ：2025/3/7 16:47
 * @Description ：For study.
 */

public class ThreadPoolExecutorDemo01 {
    public static void main(String[] args) {
        // 核心线程数量为1，最大线程数量为4，任务数量为1，空闲最大时间为10s
        // ThreadPoolExecutor.DiscardPolicy:被拒绝过后的处理程序
        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(
                1, 4, 20, TimeUnit.SECONDS,
                new ArrayBlockingQueue<>(10),
                Executors.defaultThreadFactory(), new ThreadPoolExecutor.DiscardPolicy());


    }
}
